<template>
    <Menu mode="horizontal" :theme="theme1" active-name="1">
        <MenuItem v-for='(item,key) in MenuItem' :key='key' :name="item.name" :to="item.to">
            <Icon type="item.icon" />
            {{item.title}}
        </MenuItem>
        <button @click="commitmutation" style="display: none;">test</button>
    </Menu>
</template>
<script>
    export default {
        data () {
            return {
                theme1: 'dark'
            }
        },
        props:['MenuItem'],
        created(){
            
        },
        methods:{
            commitmutation:function(){
                this.$store.commit('setUserInfo','lisa');
                this.$store.dispatch('testAction','lisa');
            }
        }
    }
</script>